package com.jonniespratley.codegen.vo
{
	import com.jonniespratley.assets.icons.MimeTypeIcons;
	
	[Bindable]
	public class GeneratedCodeVO
	{
		
		public var filename:String;
		public var contents:String;
		public var type:String;
		public var lang:String;
		public var ext:String;
		public var files:Array;
		public function GeneratedCodeVO(obj:Object = null)
		{
			if (obj != null ){
				this.filename = obj['filename'];
				this.contents = obj['contents'];
				this.type = obj['type'];
				this.lang = obj['lang'];
				this.ext = obj['ext'];
				this.files = obj['children'] as Array;
			}
		}
		
		public function get label():String{
			return this.filename;
		}
		
		public function get data():String{
			return this.contents;
		}
		
		public function get icon():Class{
			return MimeTypeIcons.getMimeIcon( this.ext );
		}
		public function get children():Array{
			return this.files;
		}

	}
}